package com.example.demo.kafka;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;


/**
 * @Author: FKJGFK
 * @Date: 2021/5/8 9:37
 * @Description:
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "kafka.topic")
public class KafkaTopicConfig implements InitializingBean {

    /**
     * 手机/设备在线使用日志
     */
    private String topicMobileOnlineLog;

    /**
     * APP用户使用日志
     */
    private String topicAppUserUseLog;

    /**
     * 每日APP出现的安全问题
     */
    private String topicAppSafeLog;

    /**
     * APP用户安装日志
     */
    private String topicAppInstallLogTopic;

    @Override
    public void afterPropertiesSet() throws Exception {
        System.setProperty("topic.MobileOnlineLog", "topic-mobile-online-log");
        System.setProperty("topic.AppUserUseLog", "topic-app-user-use-log");
        System.setProperty("topic.AppSafeLog", "topic-app-safe-log");
        System.setProperty("topic.AppInstallLog", "topic-app-install-log-topic");
    }
}